//
//  MyHeaderView.m
//  LazyCat
//
//  Created by zhanshu on 15/9/7.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "MyHeaderView.h"
#import "LoginViewController.h"
#import "MyMessViewController.h"
#import "Html5ViewController.h"
#import "OrderViewController.h"
#import "ShopManagerVC.h"
#import "SetViewController.h"
#import "serverViewController.h"

@implementation MyHeaderView

- (void)awakeFromNib {
    self.backgroundColor = SetColor(255, 255, 255, 1);
    _headerImg.layer.cornerRadius = _headerImg.width/2;
    _headerImg.layer.borderWidth = 1.5;
    _headerImg.layer.borderColor = [UIColor whiteColor].CGColor;
    _headerImg.layer.masksToBounds = YES;
    _userName.font = [UIFont boldSystemFontOfSize:18];
}
- (IBAction)userMess:(UIButton *)sender {
//    SetViewController *setview = [[SetViewController alloc] init];
//    [sender.viewController.navigationController pushViewController:setview animated:YES];
}
- (IBAction)ThreeButtonAction:(UIButton *)sender {
    if (sender.tag == 100) { // 今日订单
        OrderViewController *order = [[OrderViewController alloc] init];
        order.todayOrder = 3;
        [sender.viewController.navigationController pushViewController:order animated:YES];
    }else if (sender.tag == 200){ // 代发货
        OrderViewController *order = [[OrderViewController alloc] init];
        [sender.viewController.navigationController pushViewController:order animated:YES];
    }else if (sender.tag == 300){ // 客户管理
        serverViewController *clientVC = [[serverViewController alloc]init];
        NSUserDefaults *userDefaul = [NSUserDefaults standardUserDefaults];
        NSString *iptype = [userDefaul objectForKey:@"iptype"];
        NSString *banben = [userDefaul objectForKey:@"banben"];
        NSString *url = [NSString stringWithFormat:serverManagerUrl,[AppData share].username,[Utils md5SignStr],iptype,banben];
        clientVC.requestUrl = url;
        [sender.viewController.navigationController pushViewController:clientVC animated:YES];
    }
}
@end
